package com.web.jdbcyw1.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.web.jdbcbase.service.MenuService;
import com.web.jdbcyw1.module.User;
import com.web.jdbcyw1.service.UserService;

@Controller
@RequestMapping("/user")
public class UserController {
	@Resource
	private UserService userService1;
	@RequestMapping("/getUserList.do")
	@ResponseBody
	//http://localhost:9081/springMvc/user/getUserList
	public List<User> queryUser() {
		User u = new User();
		return userService1.queryUser(u);
	}
	@RequestMapping("/getUser")
	@ResponseBody
	public User queryUserForOne() {
		String str = "";
		return userService1.queryUserForOne(str);
	}
	@RequestMapping("/addUser")
	@ResponseBody
	public int addUser() {
		User user = new User();
		user.setName("test");
		user.setPwd("pwd的");
		return userService1.addUser(user);
	}
	
}
